<#assign contextRoot="${springMacroRequestContext.getContextPath()}" />
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html> <!--<![endif]-->
    <head>
		<#include "../include/common.ftl"/>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" href="${contextRoot}/resources/css/reset.css"/>
        <link rel="stylesheet" href="${contextRoot}/resources/bootstrap/css/bootstrap.css"/>
        <link rel="stylesheet" href="${contextRoot}/resources/bootstrap/css/bootstrap-responsive.css"/>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
        <link rel="stylesheet" href="${contextRoot}/resources/css/main.css"/>

        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
        <script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js"></script>
        <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
        <script src="${contextRoot}/resources/js/utilities.js"/></script>
	    <script src="${contextRoot}/resources/bootstrap/js/bootstrap.js"/></script>
	    <script src="${contextRoot}/resources/js/main.js"/></script>
	    <script type="text/javascript">
			var basePath = "${springMacroRequestContext.getContextPath()}";
		</script>

    </head>
    <body>
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
        <![endif]-->
        <div id="topNavBar" class="navbar navbar-inverse navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a id="projectName" class="brand" href="<@spring.url value="/index.html"/>">My Project</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav">
                            <li <#if active?? && active == "protected">class="active"</#if>><a href="<@spring.url value="/protected.html"/>">Protected</a></li>
                        </ul>
                        <#if userContext.username??>
	                        <form action="<@spring.url value="/j_spring_security_logout"/>" class="navbar-form pull-right" method="POST">
	                            <span id="welcomeMessage" class="navbar-elem">Welcome ${userContext.username}</span>
	                            <button id="signOutBtn" type="submit" class="btn">Sign out</button>
	                        </form>
                        <#else>
	                        <form action="<@spring.url value="/j_spring_security_check"/>" class="navbar-form pull-right" method="POST">
	                        	<span id="signInRequestMessage" class="navbar-elem">Please sign in</span>
	                            <input class="span2" type="text" id="loginUsername" name="j_username" placeholder="Email">
	                            <input class="span2" type="password" id="loginPassword" name="j_password" placeholder="Password">
	                            <button type="submit" class="btn" id="signInBtn">Sign in</button>
	                        	<a id="createUserLink" href="<@spring.url value="/user/create.html"/>" class="navbar-elem">Create Account</a>
	                        </form>
                        </#if>
                    </div><!--/.nav-collapse -->
                </div>
            </div>
        </div>